function queryUrlParams(str = location.href) {
  const urlIns = new URL(str)
  const map = new Map()
  urlIns.searchParams.forEach((value, key) => {
    if (!map.has(key)) {
      map.set(key, value)
    } else {
      const mapValue = map.get(key)
      const mapValueArray = Array.isArray(mapValue) ? mapValue : [mapValue]
      mapValueArray.push(value)
      map.set(key, mapValueArray)
    }
  })
  return map
}
